package com.mystore.common.utils.string;

import org.springframework.util.StringUtils;

import java.util.Arrays;

public class RightsStringUtils {
    public static String joinRights(String[] rightsArray){
        StringBuffer stringBuffer=new StringBuffer("");
        Arrays.stream(rightsArray).forEach(s -> stringBuffer.append(s).append(","));
        return stringBuffer.substring(0,stringBuffer.length()-1);
    }
    public static String[] splitRights(String rightsString){
        return StringUtils.split(rightsString,",");
    }
}
